
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">

    <title>后台</title>
    <link href="__PUBLIC__/images/favicon.ico" rel="shortcut icon" />

    <!-- Bootstrap core CSS -->
    <link rel="stylesheet" href="__PUBLIC__/css/bootstrap.min.css" />
    <link rel="stylesheet" href="__PUBLIC__/css/bootstrap-theme.min.css" />
    <link rel="stylesheet" href="__PUBLIC__/css/dashboard.css" />
    <link rel="stylesheet" href="__PUBLIC__/css/bootstrap-switch.css" />
    <link rel="stylesheet" href="__PUBLIC__/css/icheck/all.css" />
</head>

<body>

<include file="Common/topNav" />

<div class="container-fluid">
    <div class="row">
        <include file="Common/leftMenu" />
        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
        	<div class="cont-title clearfix">
        		<div class="title">轮播位管理</div>
        		<div class="btn-group"><button type="button" id="addAdvPlaceBtn" class="btn">添加</button></div>
        	</div>
            <div class="table-responsive">
                <table class="table table-striped table-hover" id="tableData">
                    <thead>
                    <tr>
                        <th>广告位ID</th>
                        <th>广告位名称</th>
                        <th>显示位置</th>
                        <th>唯一标识</th>
                        <th>宽度限制</th>
                        <th>高度限制</th>
                        <th>优先级</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <volist name="advPlaceList" id="item">
                        <tr>
                            <td>{$item.id}</td>
                            <td>{$item.name}</td>
                            <td>{$item.place}</td>
                            <td>{$item.flag}</td>
                            <td>{$item.width}</td>
                            <td>{$item.height}</td>
                            <td>{$item.position}</td>
                            <td>
                                <a thisId="{$item['id']}" class="AdvPlaceEdit" href="javascript:void(0);">编辑</a> |
                                <a thisId="{$item['id']}" class="AdvPlaceDelete" href="javascript:void(0);">删除</a>
                                <!--<a thisPath="{$org['id']}" class="setOrgAdmin" href="javascript:void(0);">管理员设置</a>-->
                            </td>
                        </tr>
                    </volist>

                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>


<include file="Common/modalHtmls" />
<script type="text/javascript" src="__PUBLIC__/js/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/bootstrap.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/bootstrap-switch.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/icheck.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/common.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/validator.min.js"></script>
<script>
    //删除广告位
    $(".AdvPlaceDelete").click(function(){
        var advpId = $(this).attr("thisId");
        common.confirm("提示","确定删除该轮播位?",function(){
            common.ajax("{:U('Admin/Content/delAdvPlace')}",{advpId:advpId},function(data){
                //console.log(data);
                common.alert("提示","轮播位删除成功!",function(){
                    common.reload();
                });
            })
        })

    });
    //
    $(".AdvPlaceEdit").click(function(){
        var advpId = $(this).attr("thisId");
        common.htmlAjax("{:U('Admin/Content/editAdvPlace')}",{advpId:advpId},function(html){
            //console.log(html);
            $("#commonModal").html(html).modal('toggle');
        })
    })
    //添加广告位
    $("#addAdvPlaceBtn").click(function(){
        common.htmlAjax("{:U('Admin/Content/newAdvPlace')}", {}, function (html) {
            $("#commonModal").html(html).modal('toggle');
        })
    })
</script>
</body>
</html>
